﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Bamuca.Codigo.DTO;
using MySql.Data.MySqlClient;
using System.Data;
using Bamuca.Codigo.DAO;

namespace Bamuca.Codigo.BO
{
    public class NaipeBo
    {
        private NaipeDao _naipeDao = new NaipeDao();

        public void Incluir(NaipeDto _naipeDto)
        {
            try
            {
                _naipeDao.Inserir(_naipeDto);
            }
            catch (MySqlException ex)
            {
                throw ex;
            }
        }

        public void Alterar(NaipeDto _naipeDto)
        {
            try
            {
                _naipeDao.Excluir(_naipeDto);
            }
            catch (MySqlException ex)
            {
                throw ex;
            }
        }

        public DataTable ConsultarTodasPorParametro(NaipeDto _naipeDto)
        {
            try
            {
                return _naipeDao.ConsultarTodosPorParametro(_naipeDto);
            }
            catch (MySqlException ex)
            {
                throw ex;
            }
        }

        public NaipeDto ConsultarUmPorParametro(NaipeDto _naipeDto)
        {
            try
            {
                return _naipeDao.ConsultarUmPorParametro(_naipeDto);
            }
            catch (MySqlException ex)
            {
                throw ex;
            }
        }
    }
}